<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:spring="http://www.springframework.org/tags"
                template="../../../layout/Template.xhtml">

    <ui:define name="menu">
        <ui:include src="${user.menu}"/>
    </ui:define>

    <ui:define name="title">
        <h:outputText value="Inscription Pedagogique"/>
    </ui:define>

    <ui:define name="footer">
        <h:outputText
                value="SPiJ - Universite de Marne la Vallee - Version 1.0"/>
    </ui:define>
    <ui:define name="content">
        <rich:panel id="createRegistrationPanel"
                    header="#{resourceBundle.createRegistrationWelcome}">
            <h:form id="createRegistrationForm">
                <h:panelGrid id="createRegistrationGrid" columns="3">
                    <h:outputText
                            value="#{resourceBundle.createRegistrationFormStudent} : "/>
                    <rich:comboBox value="#{viewScope.chooseStudent}"
                                   defaultLabel="#{resourceBundle.createRegistrationStudent}"
                                   suggestionValues="#{flowScope.listStudent}"
                                   selectFirstOnUpdate="false" id="student" required="true"
                                   requiredMessage="#{resourceBundle.createRegistrationRequiredMessageStudent}"/>
                    <h:message for="student" style="color:red"/>

                    <h:outputText
                            value="#{resourceBundle.createRegistrationFormTraining} : "/>
                    <rich:comboBox value="#{viewScope.chooseTraining}"
                                   defaultLabel="#{resourceBundle.createRegistrationTraining}"
                                   suggestionValues="#{flowScope.listTraining}"
                                   selectFirstOnUpdate="false" id="training" required="true"
                                   requiredMessage="#{resourceBundle.createRegistrationRequiredMessageTraining}"/>
                    <h:message for="training" style="color:red"/>

                    <h:outputText
                            value="#{resourceBundle.createRegistrationFormStartTime} : "/>
                    <rich:calendar value="#{viewScope.createdRegistration.startTime}"
                                   locale="#{calendarBean.locale}" popup="true"
                                   datePattern="dd/MM/yyyy" showApplyButton="false" required="true"
                                   requiredMessage="#{resourceBundle.createRegistrationRequiredMessageStartTime}"/>
                    <h:message for="startTime" style="color:red"/>

                    <h:outputText
                            value="#{resourceBundle.createRegistrationFormEndTime} : "/>

                    <rich:calendar value="#{viewScope.createdRegistration.endTime}"
                                   locale="#{calendarBean.locale}" popup="true"
                                   datePattern="dd/MM/yyyy" showApplyButton="false" required="true"
                                   requiredMessage="#{resourceBundle.createRegistrationRequiredMessageEndTime}"/>
                    <h:message for="endTime" style="color:red"/>
                </h:panelGrid>

                <h:messages globalOnly="true"/>

                <a4j:commandButton type="submit" value="#{bundle.addButton}"
                                   action="add"/>
                <a4j:commandButton value="#{bundle.cancelButton}" action="cancel"
                                   immediate="true"/>
            </h:form>
        </rich:panel>
    </ui:define>
</ui:composition>